﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Topics_Topics_Charts_delete : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            long id = long.Parse(Request["id"]);
            CMSModel.CMSEntities cms = new CMSModel.CMSEntities();
            var c=cms.Topics2Charts.First(x=>x.Id==id);
            cms.Topics2Charts.DeleteObject(c);
            cms.SaveChanges();
            ClientScript.RegisterStartupScript(GetType(), "delete", "alert('删除成功!'),document.location='Topics_Charts.aspx?tid="+Request["tid"]+"'", true);
        }
    }
}